<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont">&#xe624;</span>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe632;</span>
      <input type="text" placeholder="输入城市/景点/游玩主题" />
    </div>
    <div class="header-right" @click="toCity">
      {{ city }}
      <span class="iconfont">&#xe600;</span>
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: "Header",
  methods: {
    // 跳转到城市页面
    toCity() {
      this.$router.push({
        name:'City'
      })
    }
  },
  computed:{
    ...mapState(['city'])
  }
};
</script>

<style lang="less" scoped>
@import url("~@/assets/styles/varibles.less");

.header {
  display: flex;
  height: @HeaderHight;
  background-color: @BgColor;
  color: @headerColor;
  line-height: @headerLinerHight;
  &-left {
    float: left;
    width: 0.64rem;
    span {
      margin-left: 0.15rem;
      text-align: center;
      font-size: 0.4rem;
    }
  }
  &-input {
    flex: 1;
    margin: 0.12rem 0.1rem;
    background: #fff;
    border-radius: 0.1rem;
    line-height: 0.62rem;
    color: #ccc;
    input {
      padding-left: 0.2rem;
      margin-bottom: 0.05rem;
    }
    span {
      margin-left: 0.2rem;
    }
  }
  &-right {
    float: right;
    min-width: 1.24rem;
    padding: 0 .1rem;
    text-align: center;
    span {
      font-size: 0.24rem;
    }
  }
}
</style>
